home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / misc / 40 / pri.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-07-17  |  15.0 KB  |  739 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2. /* pri.c - version 1.0.3 */
  3.  
  4. #include <stdio.h>
  5. #include "hack.h"
  6. xchar scrlx, scrhx, scrly, scrhy;    /* corners of new area on screen */
  7.  
  8. extern char *hu_stat[];    /* in eat.c */
  9. extern char *CD;
  10.  
  11. swallowed()
  12. {
  13.     char *ulook = "|@|";
  14.     ulook[1] = u.usym;
  15.  
  16.     cls();
  17.     curs(u.ux-1, u.uy+1);
  18.     fputs("/-\\", stdout);
  19.     curx = u.ux+2;
  20.     curs(u.ux-1, u.uy+2);
  21.     fputs(ulook, stdout);
  22.     curx = u.ux+2;
  23.     curs(u.ux-1, u.uy+3);
  24.     fputs("\\-/", stdout);
  25.     curx = u.ux+2;
  26.     u.udispl = 1;
  27.     u.udisx = u.ux;
  28.     u.udisy = u.uy;
  29. }
  30.  
  31.  
  32. /*VARARGS1*/
  33. boolean panicking;
  34.  
  35. panic(str,a1,a2,a3,a4,a5,a6)
  36. char *str;
  37. {
  38.     if(panicking++) exit(1);    /* avoid loops - this should never happen*/
  39.     cls();
  40.     home();
  41.     puts(" Suddenly, the dungeon collapses.");
  42.     fputs(" ERROR:  ", stdout);
  43.     printf(str,a1,a2,a3,a4,a5,a6);
  44. #ifdef DEBUG
  45. #ifdef UNIX
  46.     if(!fork())
  47.         abort();    /* generate core dump */
  48. #endif UNIX
  49. #endif DEBUG
  50.     more();            /* contains a fflush() */
  51.     done("panicked");
  52. }
  53.  
  54. atl(x,y,ch)
  55. register x,y;
  56. {
  57.     register struct rm *crm = &levl[x][y];
  58.  
  59.     if(x<0 || x>COLNO-1 || y<0 || y>ROWNO-1){
  60.         impossible("atl(%d,%d,%c)",x,y,ch);
  61.         return;
  62.     }
  63.     if(crm->seen && crm->scrsym == ch) return;
  64.     crm->scrsym = ch;
  65.     crm->new = 1;
  66.     on_scr(x,y);
  67. }
  68.  
  69. on_scr(x,y)
  70. register x,y;
  71. {
  72.     if(x < scrlx) scrlx = x;
  73.     if(x > scrhx) scrhx = x;
  74.     if(y < scrly) scrly = y;
  75.     if(y > scrhy) scrhy = y;
  76. }
  77.  
  78. /* call: (x,y) - display
  79.     (-1,0) - close (leave last symbol)
  80.     (-1,-1)- close (undo last symbol)
  81.     (-1,let)-open: initialize symbol
  82.     (-2,let)-change let
  83. */
  84.  
  85. tmp_at(x,y) schar x,y; {
  86. static schar prevx, prevy;
  87. static char let;
  88.     if((int)x == -2){    /* change let call */
  89.         let = y;
  90.         return;
  91.     }
  92.     if((int)x == -1 && (int)y >= 0){    /* open or close call */
  93.         let = y;
  94.         prevx = -1;
  95.         return;
  96.     }
  97.     if(prevx >= 0 && cansee(prevx,prevy)) {
  98.         delay_output();
  99.         prl(prevx, prevy);    /* in case there was a monster */
  100.         at(prevx, prevy, levl[prevx][prevy].scrsym);
  101.     }
  102.     if(x >= 0){    /* normal call */
  103.         if(cansee(x,y)) at(x,y,let);
  104.         prevx = x;
  105.         prevy = y;
  106.     } else {    /* close call */
  107.         let = 0;
  108.         prevx = -1;
  109.     }
  110. }
  111.  
  112. /* like the previous, but the symbols are first erased on completion */
  113. Tmp_at2(x,y) schar x,y; {
  114. static char let;
  115. static xchar cnt;
  116. static coord tc[COLNO];        /* but watch reflecting beams! */
  117. register xx,yy;
  118.     if((int)x == -1) {
  119.         if(y > 0) {    /* open call */
  120.             let = y;
  121.             cnt = 0;
  122.             return;
  123.         }
  124.         /* close call (do not distinguish y==0 and y==-1) */
  125.         while(cnt--) {
  126.             xx = tc[cnt].x;
  127.             yy = tc[cnt].y;
  128.             prl(xx, yy);
  129.             at(xx, yy, levl[xx][yy].scrsym);
  130.         }
  131.         cnt = let = 0;    /* superfluous */
  132.         return;
  133.     }
  134.     if((int)x == -2) {    /* change let call */
  135.         let = y;
  136.         return;
  137.     }
  138.     /* normal call */
  139.     if(cansee(x,y)) {
  140.         if(cnt) delay_output();
  141.         at(x,y,let);
  142.         tc[cnt].x = x;
  143.         tc[cnt].y = y;
  144.         if(++cnt >= COLNO) panic("Tmp_at2 overflow?");
  145.         levl[x][y].new = 0;    /* prevent pline-nscr erasing --- */
  146.     }
  147. }
  148.  
  149. setclipped(){
  150.     error("Hack needs a screen of size at least %d by %d.\n",
  151.         ROWNO+2, COLNO);
  152. }
  153.  
  154. at(x,y,ch)
  155. register xchar x,y;
  156. char ch;
  157. {
  158. #ifndef lint
  159.     /* if xchar is unsigned, lint will complain about  if(x < 0)  */
  160.     if(x < 0 || x > COLNO-1 || y < 0 || y > ROWNO-1) {
  161.         impossible("At gets 0%o at %d %d.", ch, x, y);
  162.         return;
  163.     }
  164. #endif lint
  165.     if(!ch) {
  166.         impossible("At gets null at %d %d.", x, y);
  167.         return;
  168.     }
  169.     y += 2;
  170.     curs(x,y);
  171.     (void) putchar(ch);
  172.     curx++;
  173. }
  174.  
  175. prme(){
  176.     if(!Invisible) at(u.ux,u.uy,u.usym);
  177. }
  178.  
  179. doredraw()
  180. {
  181.     docrt();
  182.     return(0);
  183. }
  184.  
  185. docrt()
  186. {
  187.     register x,y;
  188.     register struct rm *room;
  189.     register struct monst *mtmp;
  190.  
  191.     if(u.uswallow) {
  192.         swallowed();
  193.         return;
  194.     }
  195.     cls();
  196.  
  197. /* Some ridiculous code to get display of @ and monsters (almost) right */
  198.     if(!Invisible) {
  199.         levl[(u.udisx = u.ux)][(u.udisy = u.uy)].scrsym = u.usym;
  200.         levl[u.udisx][u.udisy].seen = 1;
  201.         u.udispl = 1;
  202.     } else    u.udispl = 0;
  203.  
  204.     seemons();    /* reset old positions */
  205.     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  206.         mtmp->mdispl = 0;
  207.     seemons();    /* force new positions to be shown */
  208. /* This nonsense should disappear soon --------------------------------- */
  209.  
  210. #ifdef DGK
  211. /* Here are two kinds of faster redraw -dgk
  212.  *    1) Using BIOS call 0x10 for cursor and printing (may not be portable)
  213.  *    2) Using a line buffer with ANSI for a speed up of about 50%
  214.  */
  215. #ifndef TOS
  216.     if (flags.BIOSok) {
  217.         fflush(stdout);            /* make the cls() occur */
  218.         for(y = 0; y < ROWNO; y++)
  219.             for(x = 0; x < COLNO; x++)
  220.                 if((room = &levl[x][y])->new) {
  221.                     room->new = 0;
  222.                     fastat(x, y, room->scrsym);
  223.                 } else if(room->seen)
  224.                     fastat(x, y, room->scrsym);
  225.     } else {
  226. #endif TOS
  227.         for(y = 0; y < ROWNO; y++) {
  228.             char buf[COLNO+1];
  229.             int start, end;
  230. #ifdef TOS
  231.             setmem(buf, COLNO, ' ');
  232. #else
  233.             memset(buf, ' ', COLNO);
  234. #endif
  235.             for(x = 0, start = -1, end = -1; x < COLNO; x++)
  236.                 if((room = &levl[x][y])->new) {
  237.                     room->new = 0;
  238.                     buf[x] = room->scrsym;
  239.                     if (start < 0)
  240.                         start = x;
  241.                     end = x;
  242.                 } else if(room->seen) {
  243.                     buf[x] = room->scrsym;
  244.                     if (start < 0)
  245.                         start = x;
  246.                     end = x;
  247.                 }
  248.             if (end >= 0) {
  249.                 buf[end + 1] = '\0';
  250.                 curs(start, y + 2);
  251.                 fputs(buf + start, stdout);
  252.                 curx = end + 1;
  253.             }
  254.         }
  255. #ifndef TOS
  256.     }
  257. #endif TOS
  258. #else
  259.     for(y = 0; y < ROWNO; y++)
  260.         for(x = 0; x < COLNO; x++)
  261.             if((room = &levl[x][y])->new) {
  262.                 room->new = 0;
  263.                 at(x,y,room->scrsym);
  264.             } else if(room->seen)
  265.                 at(x,y,room->scrsym);
  266. #endif DGK
  267.     scrlx = COLNO;
  268.     scrly = ROWNO;
  269.     scrhx = scrhy = 0;
  270.     flags.botlx = 1;
  271.     bot();
  272. }
  273.  
  274. docorner(xmin,ymax) register xmin,ymax; {
  275.     register x,y;
  276.     register struct rm *room;
  277.     register struct monst *mtmp;
  278.  
  279.     if(u.uswallow) {    /* Can be done more efficiently */
  280.         swallowed();
  281.         return;
  282.     }
  283.  
  284.     seemons();    /* reset old positions */
  285.     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  286.         if(mtmp->mx >= xmin && mtmp->my < ymax)
  287.         mtmp->mdispl = 0;
  288.     seemons();    /* force new positions to be shown */
  289.  
  290.     for(y = 0; y < ymax; y++) {
  291.         if(y > ROWNO && CD) break;
  292.         curs(xmin,y+2);
  293.         cl_end();
  294.         if(y < ROWNO) {
  295.             for(x = xmin; x < COLNO; x++) {
  296.             if((room = &levl[x][y])->new) {
  297.                 room->new = 0;
  298.                 at(x,y,room->scrsym);
  299.             } else
  300.                 if(room->seen)
  301.                     at(x,y,room->scrsym);
  302.             }
  303.         }
  304.     }
  305.     if(ymax > ROWNO) {
  306.         cornbot(xmin-1);
  307.         if(ymax > ROWNO+1 && CD) {
  308.             curs(1,ROWNO+3);
  309.             cl_eos();
  310.         }
  311.     }
  312. }
  313.  
  314. curs_on_u(){
  315.     curs(u.ux, u.uy+2);
  316. }
  317.  
  318. pru()
  319. {
  320.     if(u.udispl && (Invisible || u.udisx != u.ux || u.udisy != u.uy))
  321.         /* if(! levl[u.udisx][u.udisy].new) */
  322.             if(!vism_at(u.udisx, u.udisy))
  323.                 newsym(u.udisx, u.udisy);
  324.     if(Invisible) {
  325.         u.udispl = 0;
  326.         prl(u.ux,u.uy);
  327.     } else
  328.     if(!u.udispl || u.udisx != u.ux || u.udisy != u.uy) {
  329.         atl(u.ux, u.uy, u.usym);
  330.         u.udispl = 1;
  331.         u.udisx = u.ux;
  332.         u.udisy = u.uy;
  333.     }
  334.     levl[u.ux][u.uy].seen = 1;
  335. }
  336.  
  337. #ifndef NOWORM
  338. #include    "wseg.h"
  339. extern struct wseg *m_atseg;
  340. #endif NOWORM
  341.  
  342. /* print a position that is visible for @ */
  343. prl(x,y)
  344. {
  345.     register struct rm *room;
  346.     register struct monst *mtmp;
  347.     register struct obj *otmp;
  348.  
  349.     if(x == u.ux && y == u.uy && (!Invisible)) {
  350.         pru();
  351.         return;
  352.     }
  353.     if(!isok(x,y)) return;
  354.     room = &levl[x][y];
  355.     if((!room->typ) ||
  356.        (IS_ROCK(room->typ) && levl[u.ux][u.uy].typ == CORR))
  357.         return;
  358.     if((mtmp = m_at(x,y)) && !mtmp->mhide &&
  359.         (!mtmp->minvis || See_invisible)) {
  360. #ifndef NOWORM
  361.         if(m_atseg)
  362.             pwseg(m_atseg);
  363.         else
  364. #endif NOWORM
  365.         pmon(mtmp);
  366.     }
  367.     else if((otmp = o_at(x,y)) && room->typ != POOL)
  368.         atl(x,y,otmp->olet);
  369.     else if(mtmp && (!mtmp->minvis || See_invisible)) {
  370.         /* must be a hiding monster, but not hiding right now */
  371.         /* assume for the moment that long worms do not hide */
  372.         pmon(mtmp);
  373.     }
  374.     else if(g_at(x,y) && room->typ != POOL)
  375.         atl(x,y,'$');
  376.     else if(!room->seen || room->scrsym == ' ') {
  377.         room->new = room->seen = 1;
  378.         newsym(x,y);
  379.         on_scr(x,y);
  380.     }
  381.     room->seen = 1;
  382. }
  383.  
  384. char
  385. news0(x,y)
  386. register xchar x,y;
  387. {
  388.     register struct obj *otmp;
  389.     register struct trap *ttmp;
  390.     struct rm *room;
  391.     register char tmp;
  392.  
  393.     room = &levl[x][y];
  394.     if(!room->seen) tmp = ' ';
  395.     else if(room->typ == POOL) tmp = POOL_SYM;
  396.     else if(!Blind && (otmp = o_at(x,y))) tmp = otmp->olet;
  397.     else if(!Blind && g_at(x,y)) tmp = '$';
  398.     else if(x == xupstair && y == yupstair) tmp = '<';
  399.     else if(x == xdnstair && y == ydnstair) tmp = '>';
  400.     else if((ttmp = t_at(x,y)) && ttmp->tseen) tmp = '^';
  401.     else switch(room->typ) {
  402.     case SCORR:
  403.     case SDOOR:
  404.         tmp = room->scrsym;    /* %% wrong after killing mimic ! */
  405.         break;
  406. #ifdef DGK
  407.     case HWALL:
  408.         tmp = room->scrsym;    /* OK for corners only */
  409.         if (!IS_CORNER(tmp))
  410.             tmp = symbol.hwall;
  411.         break;
  412.     case VWALL:
  413.         tmp = symbol.vwall;
  414.         break;
  415.     case LDOOR:
  416.     case DOOR:
  417.         tmp = symbol.door;
  418.         break;
  419.     case CORR:
  420.         tmp = symbol.corr;
  421.         break;
  422.     case ROOM:
  423.         if(room->lit || cansee(x,y) || Blind) tmp = symbol.room;
  424.         else tmp = ' ';
  425.         break;
  426. #else
  427.     case HWALL:
  428.         tmp = '-';
  429.         break;
  430.     case VWALL:
  431.         tmp = '|';
  432.         break;
  433.     case LDOOR:
  434.     case DOOR:
  435.         tmp = '+';
  436.         break;
  437.     case CORR:
  438.         tmp = CORR_SYM;
  439.         break;
  440.     case ROOM:
  441.         if(room->lit || cansee(x,y) || Blind) tmp = '.';
  442.         else tmp = ' ';
  443.         break;
  444. #endif DGK
  445. /*
  446.     case POOL:
  447.         tmp = POOL_SYM;
  448.         break;
  449. */
  450.     default:
  451.         tmp = ERRCHAR;
  452.     }
  453.     return(tmp);
  454. }
  455.  
  456. newsym(x,y)
  457. register x,y;
  458. {
  459.     atl(x,y,news0(x,y));
  460. }
  461.  
  462. /* used with wand of digging (or pick-axe): fill scrsym and force display */
  463. /* also when a POOL evaporates */
  464. mnewsym(x,y)
  465. register x,y;
  466. {
  467.     register struct rm *room;
  468.     char newscrsym;
  469.  
  470.     if(!vism_at(x,y)) {
  471.         room = &levl[x][y];
  472.         newscrsym = news0(x,y);
  473.         if(room->scrsym != newscrsym) {
  474.             room->scrsym = newscrsym;
  475.             room->seen = 0;
  476.         }
  477.     }
  478. }
  479.  
  480. nosee(x,y)
  481. register x,y;
  482. {
  483.     register struct rm *room;
  484.  
  485.     if(!isok(x,y)) return;
  486.     room = &levl[x][y];
  487. #ifdef DGK
  488.     if(room->scrsym == symbol.room && !room->lit && !Blind) {
  489. #else
  490.     if(room->scrsym == '.' && !room->lit && !Blind) {
  491. #endif DGK
  492.         room->scrsym = ' ';
  493.         room->new = 1;
  494.         on_scr(x,y);
  495.     }
  496. }
  497.  
  498. #ifndef QUEST
  499. prl1(x,y)
  500. register x,y;
  501. {
  502.     if(u.dx) {
  503.         if(u.dy) {
  504.             prl(x-(2*u.dx),y);
  505.             prl(x-u.dx,y);
  506.             prl(x,y);
  507.             prl(x,y-u.dy);
  508.             prl(x,y-(2*u.dy));
  509.         } else {
  510.             prl(x,y-1);
  511.             prl(x,y);
  512.             prl(x,y+1);
  513.         }
  514.     } else {
  515.         prl(x-1,y);
  516.         prl(x,y);
  517.         prl(x+1,y);
  518.     }
  519. }
  520.  
  521. nose1(x,y)
  522. register x,y;
  523. {
  524.     if(u.dx) {
  525.         if(u.dy) {
  526.             nosee(x,u.uy);
  527.             nosee(x,u.uy-u.dy);
  528.             nosee(x,y);
  529.             nosee(u.ux-u.dx,y);
  530.             nosee(u.ux,y);
  531.         } else {
  532.             nosee(x,y-1);
  533.             nosee(x,y);
  534.             nosee(x,y+1);
  535.         }
  536.     } else {
  537.         nosee(x-1,y);
  538.         nosee(x,y);
  539.         nosee(x+1,y);
  540.     }
  541. }
  542. #endif QUEST
  543.  
  544. vism_at(x,y)
  545. register x,y;
  546. {
  547.     register struct monst *mtmp;
  548.  
  549.     return((x == u.ux && y == u.uy && !Invisible)
  550.             ? 1 :
  551.            (mtmp = m_at(x,y))
  552.             ? ((Blind && Telepat) || canseemon(mtmp)) :
  553.         0);
  554. }
  555.  
  556. #ifdef NEWSCR
  557. pobj(obj) register struct obj *obj; {
  558. register int show = (!obj->oinvis || See_invisible) &&
  559.         cansee(obj->ox,obj->oy);
  560.     if(obj->odispl){
  561.         if(obj->odx != obj->ox || obj->ody != obj->oy || !show)
  562.         if(!vism_at(obj->odx,obj->ody)){
  563.             newsym(obj->odx, obj->ody);
  564.             obj->odispl = 0;
  565.         }
  566.     }
  567.     if(show && !vism_at(obj->ox,obj->oy)){
  568.         atl(obj->ox,obj->oy,obj->olet);
  569.         obj->odispl = 1;
  570.         obj->odx = obj->ox;
  571.         obj->ody = obj->oy;
  572.     }
  573. }
  574. #endif NEWSCR
  575.  
  576. unpobj(obj) register struct obj *obj; {
  577. /*     if(obj->odispl){
  578.         if(!vism_at(obj->odx, obj->ody))
  579.             newsym(obj->odx, obj->ody);
  580.         obj->odispl = 0;
  581.     }
  582. */
  583.     if(!vism_at(obj->ox,obj->oy))
  584.         newsym(obj->ox,obj->oy);
  585. }
  586.  
  587. seeobjs(){
  588. register struct obj *obj, *obj2;
  589.     for(obj = fobj; obj; obj = obj2) {
  590.         obj2 = obj->nobj;
  591.         if(obj->olet == FOOD_SYM && obj->otyp >= CORPSE
  592.             && obj->age + 250 < moves)
  593.                 delobj(obj);
  594.     }
  595.     for(obj = invent; obj; obj = obj2) {
  596.         obj2 = obj->nobj;
  597.         if(obj->olet == FOOD_SYM && obj->otyp >= CORPSE
  598.             && obj->age + 250 < moves)
  599.                 useup(obj);
  600.     }
  601. }
  602.  
  603. seemons(){
  604. register struct monst *mtmp;
  605.     for(mtmp = fmon; mtmp; mtmp = mtmp->nmon){
  606.         if(mtmp->data->mlet == ';')
  607.             mtmp->minvis = (u.ustuck != mtmp &&
  608.                     levl[mtmp->mx][mtmp->my].typ == POOL);
  609.         pmon(mtmp);
  610. #ifndef NOWORM
  611.         if(mtmp->wormno) wormsee(mtmp->wormno);
  612. #endif NOWORM
  613.     }
  614. }
  615.  
  616. pmon(mon) register struct monst *mon; {
  617. register int show = (Blind && Telepat) || canseemon(mon);
  618.     if(mon->mdispl){
  619.         if(mon->mdx != mon->mx || mon->mdy != mon->my || !show)
  620.             unpmon(mon);
  621.     }
  622.     if(show && !mon->mdispl){
  623.         atl(mon->mx,mon->my,
  624.          (!mon->mappearance
  625.           || u.uprops[PROP(RIN_PROTECTION_FROM_SHAPE_CHANGERS)].p_flgs
  626.          ) ? mon->data->mlet : mon->mappearance);
  627.         mon->mdispl = 1;
  628.         mon->mdx = mon->mx;
  629.         mon->mdy = mon->my;
  630.     }
  631. }
  632.  
  633. unpmon(mon) register struct monst *mon; {
  634.     if(mon->mdispl){
  635.         newsym(mon->mdx, mon->mdy);
  636.         mon->mdispl = 0;
  637.     }
  638. }
  639.  
  640. nscr()
  641. {
  642.     register x,y;
  643.     register struct rm *room;
  644.  
  645.     if(u.uswallow || u.ux == FAR || flags.nscrinh) return;
  646.     pru();
  647.     for(y = scrly; y <= scrhy; y++)
  648.         for(x = scrlx; x <= scrhx; x++)
  649.             if((room = &levl[x][y])->new) {
  650.                 room->new = 0;
  651.                 at(x,y,room->scrsym);
  652.             }
  653.     scrhx = scrhy = 0;
  654.     scrlx = COLNO;
  655.     scrly = ROWNO;
  656. }
  657.  
  658. /* 100 suffices for bot(); no relation with COLNO */
  659. char oldbot[100], newbot[100];
  660. cornbot(lth)
  661. register int lth;
  662. {
  663.     if(lth < sizeof(oldbot)) {
  664.         oldbot[lth] = 0;
  665.         flags.botl = 1;
  666.     }
  667. }
  668.  
  669. bot()
  670. {
  671. register char *ob = oldbot, *nb = newbot;
  672. register int i;
  673. extern char *eos();
  674.     if(flags.botlx) *ob = 0;
  675.     flags.botl = flags.botlx = 0;
  676. #define GOLD_ON_BOTL
  677. #ifdef GOLD_ON_BOTL
  678.     (void) sprintf(newbot,
  679.         "Level %-2d  Gold %-5lu  Hp %3d(%d)  Ac %-2d  Str ",
  680.         dlevel, u.ugold, u.uhp, u.uhpmax, u.uac);
  681. #else
  682.     (void) sprintf(newbot,
  683.         "Level %-2d   Hp %3d(%d)   Ac %-2d   Str ",
  684.         dlevel,  u.uhp, u.uhpmax, u.uac);
  685. #endif GOLD_ON_BOTL
  686.     if(u.ustr>18) {
  687.         if(u.ustr>117)
  688.         (void) strcat(newbot,"18/**");
  689.         else
  690.         (void) sprintf(eos(newbot), "18/%02d",u.ustr-18);
  691.     } else
  692.         (void) sprintf(eos(newbot), "%-2d   ",u.ustr);
  693. #ifdef EXP_ON_BOTL
  694.     (void) sprintf(eos(newbot), "  Exp %2d/%-5lu ", u.ulevel,u.uexp);
  695. #else
  696.     (void) sprintf(eos(newbot), "   Exp %2u  ", u.ulevel);
  697. #endif EXP_ON_BOTL
  698.     (void) strcat(newbot, hu_stat[u.uhs]);
  699.     if(flags.time)
  700.         (void) sprintf(eos(newbot), "  %ld", moves);
  701.     if(strlen(newbot) >= COLNO) {
  702.         register char *bp0, *bp1;
  703.         bp0 = bp1 = newbot;
  704.         do {
  705.             if(*bp0 != ' ' || bp0[1] != ' ' || bp0[2] != ' ')
  706.                 *bp1++ = *bp0;
  707.         } while(*bp0++);
  708.     }
  709.     for(i = 1; i<COLNO; i++) {
  710.         if(*ob != *nb){
  711.             curs(i,ROWNO+2);
  712.             (void) putchar(*nb ? *nb : ' ');
  713.             curx++;
  714.         }
  715.         if(*ob) ob++;
  716.         if(*nb) nb++;
  717.     }
  718.     (void) strcpy(oldbot, newbot);
  719. }
  720.  
  721. #ifdef WAN_PROBING
  722. mstatusline(mtmp) register struct monst *mtmp; {
  723.     pline("Status of %s: ", mon_nam(mtmp));
  724.     pline("Level %-2d  Gold %-5lu  Hp %3d(%d)  Ac %-2d  Dam %d",
  725.         mtmp->data->mlevel, mtmp->mgold, mtmp->mhp, mtmp->mhpmax,
  726.         mtmp->data->ac, (mtmp->data->damn + 1) * (mtmp->data->damd + 1));
  727. }
  728. #endif WAN_PROBING
  729.  
  730. cls(){
  731.     if(flags.toplin == 1)
  732.         more();
  733.     flags.toplin = 0;
  734.  
  735.     clear_screen();
  736.  
  737.     flags.botlx = 1;
  738. }
  739.